<?php
/**
 * This class for business order table's common methods
 */
abstract class WacBizOrderTable extends WacCommonTable
{
    /*
     * get item corresponding consume
     * @objItem - factory object
     */
    public function getListByDeliveryDate($params, $page=1, $rows=1, $isArr=true)
    {
        $condParams = array();
        $condParams['orderBy'] = "t1.delivery_date asc, t1.id asc";
        $condParams['andWhere'][] = "t1.is_avail=1";
        $condParams['andWhere'][] = "t1.delivery_date>='{$params['minDate']}'";
        $condParams['andWhere'][] = "t1.delivery_date<='{$params['maxDate']}'";

        if($params['status']==StaticWacFormStatus::$init){
            $condParams['andWhere'][] = "t1.status=".StaticWacFormStatus::getId(StaticWacFormStatus::$init);
        }
        return $this->getList($condParams, $page, $rows, $isArr);
    }
}